<?php

/**
 * @author PeoneEr
 */

require_once "core/db.php";

class Mexchange1 extends DB {

	private $_query;
	private $_fetch = array();

    protected function getCountItemsFromChar($charId, $itemId) {
        /**
         *  кол-во предметов для обмена
         * @param int $charId
         * @param int $itemId
         * @return кол-во предметов
         */
		 DB::getInstance()->openConnectionToGS();
        $this->_query = "SELECT `itemCount` FROM `inventory` WHERE `itemOwner` = '$charId' AND `itemId` = '$itemId'";
        $fetch = mysql_fetch_assoc(DB::getInstance()->sql($this->_query));
        return $fetch['itemCount'];
        DB::getInstance()->closeConnection();
		unset($this->_query, $this->_fetch);
    }

}

?>
